package com.example.springboot;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableTransactionManagement
//@ServletComponentScan(basePackages = "com.example.springboot.filter")
@ServletComponentScan(basePackages = "com.example.springboot.servlet")
//Mybatis 提供的注解：扫描数据持久层的 mapper 映谢配置文件,DAO 接口上就不用加@Mapper
//basePackages 通常指定到数据持久层包即可
//@MapperScan(basePackages = "com.abc.springboot.mapper")
public class SpringbootFirstApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootFirstApplication.class, args);
    }


    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {


//参数为当前 SpringBoot 启动类
        return builder.sources(SpringbootFirstApplication.class);
    }
}
